<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>函数</title>
</head>
<body>
<script>
    //JavaScript中函数的引用就是对象
    // 函数==对象
    function sayHello() {
        return "helloworld!";
    }
    sayHello();//调用函数
    sayHello//引用函数
    const a = {};
    a.f = sayHello;
    a.f();
    console.log(a.f())
    //把函数添加到数组里
    const arr = [11,12,13];
    arr[1] = sayHello;
    arr[1]();
    console.log(arr[1]());
</script>
</body>
</html>